<template>
  <div class="wrapper">
    <swiper :options="swiperOption" ref="mySwiper">
      <swiper-slide v-for="item of swiperList" :key='item.id'>
        <img class="img" :src= "item.imgurl">
      </swiper-slide>
      <div class="swiper-pagination"  slot="pagination"></div>
    </swiper>
  </div>
</template>
<script>
export default {
  name: 'HomeSwiper',
  data() {
    return {
      swiperOption: {
        pagination: {
          el: '.swiper-pagination',
          clickable: true
        },
        loop: true
      },
      swiperList: [
        {
          id: '0001',
          imgurl:
            'https://source.qunarzz.com/site/images/wap/home/recommend/iphoneplus/dujia_shuqi_banner_20180710.jpg'
        },
        {
          id: '0002',
          imgurl:
            'https://source.qunarzz.com/site/images/wap/home/recommend/iphoneplus/anquan_20180716.png'
        }
      ]
    }
  }
}
</script>

<style lang='stylus' scopend>
.swiper-pagination .swiper-pagination-bullet-active {
  background: #fff
}

.swiper-pagination-bullet {
  background: #000
}

.wrapper {
  overflow: hidden
  width: 100%
  height: 0
  padding-bottom: 31.25%

  .img {
    width: 100%
  }
}
</style>
